<?php  
	include('./db/dbconn.php');
	if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
		$bugs_t = $_POST['bugs_title'];
		$bugs_title = iconv('utf-8', 'gbk', $bugs_t);
		$bugs_f = "未解决";
		$bugs_fix = iconv('utf-8', 'gbk', $bugs_f);
		
		$sql = "insert into bugs(bugs_title, bugs_fix) values('$bugs_title','$bugs_fix')";
		mysqli_query($conn, $sql);
		
		$json = array("status" => "success", "data" => "$bugs_t", "content" => "$bugs_f");
		echo json_encode($json);
	} else {
		$json_err = array("status" => "fail");
		echo json_encode($json_err);
	}
?>  